﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleRest.Core.Exceptions
{
    /// <summary>
    /// Base exception used to drive exception handling and tie http status codes.  Inherit from this class to provide more REST pipeline
    /// context upon throwing an exception.
    /// </summary>
    public abstract class WebExceptionBase : Exception
    {
        public WebExceptionBase() { }
        public WebExceptionBase(string message)
            : base(message) { }
        public WebExceptionBase(string message, Exception ex)
            : base(message, ex) { }

        /// <summary>
        /// The associated http status code for the thrown exception.
        /// </summary>
        public abstract System.Net.HttpStatusCode StatusCode { get; }

        /// <summary>
        /// The error code associated to the exception.
        /// </summary>
        public abstract string ErrorCode { get; }
    }
}
